<?php
/**
 *  时间函数
 */
class Date_time{
	
	public $time;	//起始时间
	
	public function __construct($date='') {
		if(empty($date)){
			$this->time = time();
		}else{
			$this->time = $date;
		}
	}
	
	/**
	 * 本日到上个月的今天（15天）
	 */
	public function month(){
		$date = array();
		
		for($i = 0 ; $i <= 15 ; $i ++){
			$time = date('Y-m-d',$this->time-(60*60*24*$i));
			$begin = strtotime($time);
			$end = $begin+60*60*24;
			$date[] = array(
					'day' => date('m-d',$begin),
					'b'	=> $begin,
					'e' => $end
			);
		}
		
		return $date;
	}

}